package com.song.seckill.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface SeckillMapper {

    @Update(value = "update sku_stock set stock_count = #{stockCount} where sku_id = #{skuId} and stock_count > 0")
    int updateStock(@Param("skuId") String skuId,
                     @Param("stockCount") int stockCount) ;
}
